﻿<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <link rel="shortcut icon" href="@Url.Content("~/icon.png")" />
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="@Url.Content("~/assets/global/plugins/font-awesome/css/font-awesome.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/simple-line-icons/simple-line-icons.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap/css/bootstrap.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/uniform/css/uniform.default.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/dhqg.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css")" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
    <link href="@Url.Content("~/assets/global/plugins/gritter/css/jquery.gritter.css")" rel="stylesheet" type="text/css" />
    <!-- END PAGE LEVEL PLUGIN STYLES -->
    <!-- BEGIN PAGE STYLES -->
    <link href="@Url.Content("~/assets/admin/pages/css/tasks.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/select2/select2.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-datepicker/css/datepicker.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/clockface/css/clockface.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-datepicker/css/datepicker3.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-timepicker/css/bootstrap-timepicker.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-colorpicker/css/colorpicker.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-datetimepicker/css/datetimepicker.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/fancybox/source/jquery.fancybox.css")" rel="stylesheet" type="text/css" />
    <link href="~/Content/main.css" rel="stylesheet" />
    <!-- END PAGE STYLES -->
    <!-- BEGIN THEME STYLES -->
    <link href="@Url.Content("~/assets/global/css/components.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/css/plugins.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/admin/layout/css/layout.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/admin/layout/css/themes/light.css")" rel="stylesheet" type="text/css" id="style_color" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-toastr/toastr.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/admin/layout/css/custom.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/mfb.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/main.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/hover.css")" rel="stylesheet" type="text/css" />
    <!-- END THEME STYLES -->
    <link rel="shortcut icon" href="favicon.ico" />

    <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
    <!-- BEGIN CORE PLUGINS -->
    <!--[if lt IE 9]>
    <script src="@Url.Content("~/assets/global/plugins/respond.min.js")"></script>
    <script src="@Url.Content("~/assets/global/plugins/excanvas.min.js")"></script>
    <![endif]-->
    <script src="@Url.Content("~/assets/global/plugins/jquery-1.11.0.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery-migrate-1.2.1.min.js")" type="text/javascript"></script>
    <!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
    <script src="@Url.Content("~/assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/bootstrap/js/bootstrap.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery.blockui.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery.cokie.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/uniform/jquery.uniform.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js")" type="text/javascript"></script>
    <!-- END CORE PLUGINS -->
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <script src="@Url.Content("~/assets/global/plugins/gritter/js/jquery.gritter.js")" type="text/javascript"></script>
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script src="@Url.Content("~/assets/global/plugins/bootstrap-toastr/toastr.min.js")"></script>
    <script src="@Url.Content("~/assets/global/scripts/metronic.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/admin/layout/scripts/layout.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/select2/select2.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/bootbox/bootbox.min.js")"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery-easypiechart/jquery.easypiechart.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery.sparkline.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/admin/pages/scripts/index.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.session.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/DHQG/jquery.cookie.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/DHQG/numeral.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/DHQG/tableHeadFixer.js")" type="text/javascript"></script>

    <!-- END PAGE LEVEL SCRIPTS -->
    <script>
        jQuery(document).ready(function () {
            Metronic.init(); // init metronic core componets
            Layout.init(); // init layout
        });
    </script>
    <!-- END JAVASCRIPTS -->
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed page-quick-sidebar-over-content " style="overflow:auto;">
    
    <div id="_AjaxLoading" style="display:none" >
        Đang xử lý...
    </div>
    <!-- BEGIN HEADER -->
    <div class="page-header navbar navbar-fixed-top">
        <!-- BEGIN HEADER INNER -->
        <div class="page-header-inner">
            <!-- BEGIN LOGO -->
            
            <div class="page-logo" >
                <a href="@Url.Content("~/Home/Manage")">
                    
                </a>
                <ul class="logo-text">
                    <li>V</li>
                    <li>N</li>
                    <li>U</li>
                </ul>
                <div class="menu-toggler sidebar-toggler hide">
                    <!-- DOC: Remove the above "hide" to enable the sidebar toggler button on header -->
                </div>
            </div>
            <!-- END LOGO -->
            
            
            <h1 class="pull-left" style="margin: 6px 0px 0px 0px; color:#fff; font-family:'Times New Roman'">HỆ THỐNG QUẢN LÝ THÔNG TIN KẾ HOẠCH</h1>
            <!-- BEGIN RESPONSIVE MENU TOGGLER -->
            <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">
            </a>
            <!-- END RESPONSIVE MENU TOGGLER -->
            <!-- BEGIN TOP NAVIGATION MENU -->
            @{
                DHQGHN.PM2.Security.MyPrincipalSerializeModel Info = new DHQGHN.PM2.Security.MyPrincipalSerializeModel();
                string tenVietTat = string.Empty;
                if (HttpContext.Current.User.Identity.IsAuthenticated)
                {
                    if (Session["UserInfo"] != null)
                    {
                        Info = Session["UserInfo"] as DHQGHN.PM2.Security.MyPrincipalSerializeModel;                        
                    }

                    if (Session["NguoiDungInfo"] != null)
                    {
                        DHQGHN.PM2.Models.DHQG.NguoiDungModel userInfo = Session["NguoiDungInfo"] as DHQGHN.PM2.Models.DHQG.NguoiDungModel;
                        if (userInfo != null)
                        {
                            if (userInfo.listDonVi != null && userInfo.listDonVi.Count > 0)
                            {
                                tenVietTat = userInfo.listDonVi[0].TenVietTat;
                            }
                        }
                    }
                }
            }
            @if (Info.CountDay < 5)
            {
                <div class="page-logo" style="background-color:red;color:white;margin:0 auto;">
                    <ul style="padding-left: 0px;">
                    
                            <li style="list-style:none; width:200px; padding-top:10px;">
                                <i class="glyphicon glyphicon-warning-sign"></i>
                                Tài khoản còn @Info.CountDay ngày sử dụng
                            </li>
                    </ul>
                </div>
            }
            <div class="top-menu">
                <ul class="nav navbar-nav pull-right">
                    <li class="dropdown dropdown-user">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-close-others="true">
                            @*<img alt="" class="img-circle" src="@Url.Content("~/assets/admin/layout/img/avatar2.jpg")">*@
                            <img alt="" class="img-circle" src="@Url.Content("~/assets/images/user.png")">
                                @if (tenVietTat.Length > 0 && @Info.FullName !=null &&  @Info.FullName.Length > 0)
                                {   <span class="username">
                                        @Info.FullName - @tenVietTat    
                                    </span>
                                }
                                else if (Info.FullName != null && Info.FullName.Length > 0)
                                {   <span class="username">
                                        @Info.FullName    
                                    </span>
                                }
                                else if (tenVietTat.Length > 0)
                                {   <span class="username">
                                        @Info.UserName - @tenVietTat    
                                    </span>
                                }
                            <i class="fa fa-angle-down"></i>
                        </a>
                        <ul class="dropdown-menu">
                            <li class="eborder-top">
                                <a href="#" aria-hidden="true" role="menu" data-toggle="modal" data-target="#myModal" onclick="ViewChangePassWord()"><i class="glyphicon glyphicon-user"></i> Thay đổi mật khẩu</a>
                            </li>
                            <li>
                                <a href="@Url.Content("~/Account/Logoff")">
                                    <i class="icon-key"></i> Đăng xuất
                                </a>
                            </li>
                        </ul>
                    </li>
                    <!-- END USER LOGIN DROPDOWN -->
                </ul>
            </div>
            <!-- END TOP NAVIGATION MENU -->
        </div>
        <!-- END HEADER INNER -->
    </div>
    <!-- END HEADER -->
    <div class="clearfix">
    </div>
    <!-- BEGIN CONTAINER -->
    <div class="page-container">
        <!-- BEGIN SIDEBAR -->
        <div id="main-nav-bg"></div>
        <div class="page-sidebar-wrapper">
            <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
            <!-- DOC: Change data-auto-speed="200" to adjust the sub menu slide up/down speed -->
            <div class="page-sidebar navbar-collapse collapse">
                <!-- BEGIN SIDEBAR MENU -->
                @** ham de quy de tao ra menu con*@
                @helper RenderMenuItem(List<DHQGHN.PM2.Models.MenuModel> menuList, DHQGHN.PM2.Models.MenuModel mi)
{
    foreach (var cp in menuList.Where(p => p.ParentMenuId == mi.MenuId))
    {
        string[] spl = SplitUrl(cp.MenuUrl);
        <li mid="@cp.MenuId" class="@ViewBag.ActiveMenus[cp.MenuId]">
            @*Html.ActionLink(cp.MenuName, spl[2], spl[1], routeValues: null, htmlAttributes: new { @id = "cName" })
            *@
            <a href="@Url.Action(spl[2], spl[1])"><i class="fa fa-hdd-o"></i> @cp.MenuName</a>
        </li> 
    }
}

                @*ham cat chuoi url*@
                @functions{
                    public string[] SplitUrl(string urlString)
                    {
                        string[] word;
                        if (urlString != "#")
                        {
                            return word = urlString.Split('/');
                            //return word;
                        }
                        else //return word = urlString.Split('#');
                            return word = new string[] { "", "", "" };
                    }
                }

                @{
                    ViewBag.ActiveMenus = ViewBag.ActiveMenus == null ? new System.Collections.Hashtable() : ViewBag.ActiveMenus;
                }

                <ul class="page-sidebar-menu " data-auto-scroll="true" data-slide-speed="200">
                    <!-- DOC: To remove the sidebar toggler from the sidebar you just need to completely remove the below "sidebar-toggler-wrapper" LI element -->
                    <li class="sidebar-toggler-wrapper">
                        <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                        <div class="sidebar-toggler">
                           
                        </div>
                        <!-- END SIDEBAR TOGGLER BUTTON -->
                    </li>
                    <li mid="0" class="start @ViewBag.ActiveMenus[0]" style="margin-top:5px;">
                        <a href="@Url.Action("Manage","Home")">
                            <i class="icon-home"></i>
                            <span class="title">Trang chủ</span>
                        </a>
                    </li>
                    @{
                        if (HttpContext.Current.User.Identity.IsAuthenticated)
                        {
                            if (Session["MenuList"] != null)
                            {
                                System.Collections.Hashtable icons = new System.Collections.Hashtable();
                                icons[0] = "fa fa-gears";
                                icons[1] = "fa fa-sitemap";
                                icons[2] = "fa fa-file-powerpoint-o";
                                icons[3] = "fa fa-key";
                                icons[4] = "fa fa-spinner";
                                icons[5] = "fa fa-calendar-o";

                                List<DHQGHN.PM2.Models.MenuModel> listMenu = Session["MenuList"] as List<DHQGHN.PM2.Models.MenuModel>;//ViewBag.Menu;//new List<DHQGHN.PM2.Models.MenuModel>();
                                if (listMenu.Count > 0)
                                {
                                    int iMenu = 0;
                                    foreach (var mp in listMenu.Where(p => p.ParentMenuId == 0))
                                    {
                                        string[] spl = SplitUrl(mp.MenuUrl);
                                        <li mid="@mp.MenuId" class="@ViewBag.ActiveMenus[mp.MenuId]">
                                            <a href="@Url.Action(spl[2], spl[1])"><i class="@icons[iMenu]"></i> <span class="title">@mp.MenuName</span> <span class="arrow"></span></a>
                                            <ul class="sub-menu">
                                                @RenderMenuItem(listMenu, mp)
                                            </ul>
                                        </li>
                                        ++iMenu;
                                    }
                                }
                            }
                        }
                        else
                        {
                            <li>@Html.ActionLink("Login", "Login", "Account")</li>
                            <li>@Html.ActionLink("Register", "Register", "Account")</li>
                        }
                    }
                </ul>
                <!-- END SIDEBAR MENU -->
            </div>
        </div>
        @Html.Partial("~/Views/Shared/_NoticePartial.cshtml")
        <!-- END SIDEBAR -->
        <!-- BEGIN CONTENT -->
        <div class="page-content-wrapper">
            <div class="page-content">
                @RenderBody()
                <center>
                    <div class="modal fade" id="myModal" role="dialog">
                        <div class="modal-dialog modal-lg">
                            <div class="modal-content" style="width:500px;">
                                <div class="modal-header" style="background-color: #2d6ca2;">
                                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                                    <h4 class="modal-title" style="color:white;">Thay đổi mật khẩu</h4>
                                </div>
                                <div class="modal-body" id="control-content" style="width:500px;">

                                </div>

                            </div>
                        </div>
                    </div>
                </center>
            </div>
        </div>
        <!-- END CONTENT -->
    </div>
    <!-- END CONTAINER -->
    <!-- BEGIN FOOTER -->
    <div class="page-footer">
        <div class="page-footer-inner">
            2016 &copy; ĐH Quốc Gia Hà Nội
        </div>
        <div class="scroll-to-top">
            <i class="icon-arrow-up"></i>
        </div>
    </div>
    <div class="modalloading"></div>
    <!-- END FOOTER -->

</body>
<!-- END BODY -->
</html>

<script>
    @functions{
        public string GetAntiForgeryToken()
        {
            string cookieToken, formToken;
            AntiForgery.GetTokens(null, out cookieToken, out formToken);
            return cookieToken + "," + formToken;
        }
    }
    var StringToken = { 'VerificationToken': "@GetAntiForgeryToken()" };

    function ViewChangePassWord() {
        $.ajax({
            url: "@Url.Action("AccountChangePass", "Enumerator")",
            async: false,
            type: "Post",
            dataType: "html",
            headers: StringToken,
            success: function myfunctionSuccess(data, textStatus, jqXHR) {
                $('#control-content').html(data);
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert('Có lỗi xảy ra trong quá xử lý: ' + errorThrown);
            }
        });
    }

    function warning(message, title) {
        var box = bootbox.dialog({
            title: title,
            message: message,
            onEscape: function () {
                box.modal('hide');
            },
            buttons: {
                success: {
                    label: "Đóng",
                    className: "btn btn-sm btn-default",//"btn-danger",
                    callback: function () {
                        
                    }
                }
                //,
                //danger: {
                //    label: "<i class='fa fa-reply'></i> Đóng",
                //    className: "btn btn-sm btn-default",//"btn-danger",
                //    callback: function () {
                //        return false;
                //    }
                //}
            }
        });
    }
</script>
<script>
    $(document).on({
        ajaxStart: function () {
            $body = $("body");
            $body.addClass("loading");
            $('.modalloading').show();
        },
        ajaxStop: function () {
            $('.modalloading').hide();

        }
    });
    //$("#_AjaxLoading").dialog({
    //    autoOpen: false,
    //    modal: true,
    //    width: 250,
    //    dialogClass: 'noTitleStuff',
    //    height: 80,
    //    resizable: false,
    //    show: {
    //        effect: "fade",
    //        duration: 200
    //    },
    //    hide: {
    //        effect: "fade",
    //        duration: 200
    //    }
    //});
</script>